<jsp:useBean id="organism" class="dasregistry.OrganismBean" scope="session"/>
<jsp:setProperty name="organism" property="*"/>
<%@ include file="sangerheader.jsp"%>

<%
	String title = "Added Organism" ;
 	String header = title;
%>

<HTML>
<HEAD>
<META NAME="ROBOTS" CONTENT="NOFOLLOW">

 <title><%
    		if (title == null) {
    		title = "DAS registration - server";
    	}
    	out.print(title);
    %></title>
    <link rel="stylesheet"    type="text/css"     href="stylesheet.css" />
    <link rel="shortcut icon" type="image/x-icon" href="favicon.ico" />
	 <script type="text/javascript" src="dropdown.js" language="javascript" ></script>
  
<%
  	String email = (String) session.getAttribute("email");
  	RegistryUser user = new RegistryUser();
  	boolean isAdmin = false;
  	if (email != null) {
  		UserManager um = new UserManager();
  		user = um.getUser(email);
  		if (Role.isAdmin(user)) {
  			isAdmin = true;
  		}
  	}
%>  
</HEAD>
<body>
<%@ include file="pagebodystart.jsp" %>
<div id="main">


<% if(! isAdmin) 
   { %> 
   You are not logged in as administrator. Only administrator can create new organism.   
   <a href="login.jsp">login</a>.
   <% } 
   else { %>



You provided data:<br/>
Scientific Name:     <%=organism.getScientificName()%><br/>
Common Name:  <%= organism.getCommonName()%><br/>
Taxanomic Id: <%=organism.getTaxId() %><br/>


<% 	if ( organism.create() == 1 ) {
		out.print("<h2></font color=\"blue\">Organism successfully registered </font></h2>");
	}
	else  {	
		out.print("<h2><font color=\"red\">could not register coordinate system:<br>");
		out.print(organism.getMessage()+"</font></h2>");
	}
}
%>

</div>

<%@ include file="sangerfooter.jsp" %>
